<?php 
$sql =	"SELECT
			  c.class,
			  d.Name,
			  d.description,
			  d.meta_key,
			  d.meta_description	
		  FROM
			  category AS c,
			  category_description AS d
		  WHERE
		  
			  c.category_id = d.category_id
			  AND
			  d.lang_id = '".$_SESSION['lang_id']."'
			  AND
			  c.category_id = '".$sef_url."'
		  ";
$result = query($sql);
$row = mysql_fetch_object($result);

$_SESSION['category_id'] = $sef_url;
head(sth($row->Name),sth($row->meta_description),sth($row->meta_key));


?>

    
        <section id="product-container">
        <header>
               <h5><a style="color:#FFF;" onclick="window.history.back(); return false;" href="#">&larr;</a> <?=$row->Name?></h5>
               
           </header>
        </section>
           
        <div id="product-grid">
            <ul>
        <?php 

            $sql = "SELECT
            c.cover,
		    d.title,
			d.meta_description,
            s.sef_url


        FROM
            products AS c,
            product_description AS d,
            product_to_category AS p2c,
            sef_url AS s
        WHERE
            p2c.product_id =  c.product_id
            AND 
            p2c.category_id = '".$sef_url."'
            AND 
            s.query = c.product_id

            AND

            c.product_id = d.product_id

            AND
            s.tamplate='product'

            AND

            d.lang_id = '".$_SESSION['lang_id']."'

            AND

            s.lang_id = '".$_SESSION['lang_id']."'

            AND c.published


            ORDER BY  c.order_number DESC

          ";
        $result = query($sql);

        while ($row = mysql_fetch_object($result)) {


		?>
                <li class="product-item">
                            <a href="<?=HTTPS_BASE.$row->sef_url?>">
                                <h5><?=$row->title?></h5>
                                <div class="product-item-name"><?=$row->meta_description?></div>
                                <div class="product-item-image">
                                     <img src="<?=HTTPS_BASE?>product_images/big/<?=$row->cover?>" alt="<?=$row->title?>" title="<?=$row->title?>"/>
                                </div>
                            </a>
                </li>
        
        
        <?php }?>

        
     	</ul>
       </div> <!--#product-grid-->



		
		
<?php
foot();
?>